if (!jsx3.lang.Class.forName("ux.megatron.example.tour.resource.TestResourcePage")) {

jsx3.Class.defineClass(
    "ux.megatron.example.tour.resource.TestResourcePage",
    jsx3.gui.Block,
    null,
    function (objRoot) {

            var showSource = function(txtSource, value) {
                txtSource.setValue(value, true);
            }

            objRoot.prototype.onAfterDeserialize = function() {

                var me = this;
                this.txtSource = this.getDescendantOfName("txtSource");
                this.btnLoadResource = this.getDescendantOfName("btnLoadResource");
                this.btnLoadJs = this.getDescendantOfName("btnLoadJS");
                this.btnLoadJss = this.getDescendantOfName("btnLoadJss");

                this.btnLoadResource.clickHandler = this.createBind(this.testLoadResource, this);
                this.btnLoadJs.clickHandler = this.createBind(this.testLoadJavascript, this);
                this.btnLoadJss.clickHandler = this.createBind(this.testLoadJss, this);

            }

            objRoot.prototype.createBind = function(fnct, content) {
                return function() {
                    fnct.apply(content, arguments);
                }    
            }

            objRoot.prototype.testLoadResource = function() {
                var rootDir = "ux/megatron/example/tour/resource/test/";
                var namespace = "ux.megatron.example.tour";
                ux.megatron.Main.loadResource(rootDir + "testXML.xml", namespace, "testXM-xxxx", "xml");
                var xml = ux.megatron.Main.getServer().getCache().getDocument("testXM-xxxx").toString();
                this.txtSource.setValue(xml, true);
            }

            objRoot.prototype.testLoadJavascript = function() {
                var rootDir = "ux/megatron/example/tour/resource/test/";
                var namespace = "ux.megatron.example.tour";
                ux.megatron.Main.loadClass(rootDir + "testJs.js", namespace);
                ux.megatron.example.tour.resource.TestJsObject.fun("Hello to TestJs");
                this.txtSource.setValue("", true);
            }

            objRoot.prototype.testLoadJss = function() {
                var rootDir = "ux/megatron/example/tour/resource/test/";
                var namespace = "ux.megatron.example.tour";
                ux.megatron.Main.loadResource(rootDir + "testJss.xml", namespace, "testJss", "jss");
                var xml = ux.megatron.Main.getServer().getCache().getDocument("testJss").toString();
                this.txtSource.setValue(xml, true);
                alert(["Get Jss Info", 
                    "@@test@testName1 = " + ux.megatron.Main.getServer().getDynamicProperty("@@test@testName1"),
                    "@@test@testName2 = " + ux.megatron.Main.getServer().getDynamicProperty("@@test@testName2")].join("\n")
                    );
            }
    });

}